<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
<meta charset="UTF-8"/>
<title>运营平台</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta name="renderer" content="webkit">
<!--<meta http-equiv="X-UA-Compatible" content="IE=edge">-->
<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/css/common.css?v=20170207" />
<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/css/table.css?v=20170117" />
<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/css/jquery-ui.css" />
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery-1.11.1.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery-ui.min.js" type="text/javascript"></script>
 <script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/yunIndex.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery-ym-datePlugin-0.1.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/global.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/cheshan/js/common.js" type="text/javascript"></script>
<script type="text/javascript" src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery.placeholder.min.js"></script>
<script type="text/javascript">
 $(function(){
     $("input").placeholder();
     if (navigator.userAgent.indexOf("Safari") > -1) {
       $("input").css("lineHeight","normal !important");
     };
});
</script>

<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/css/cashier.css" />
<style>
    table {font-size: 14px;}
    table input {  width: 65px;  height: 20px;  text-align: inherit;  color: black;  }
</style>
</head>
<body>
<div class="header">
<div class="headerCo">
<span>你好,<?php echo ($user_info["real_name"]); ?><a href="<?php echo (WEB_URL); ?>Emp/logout">退出</a></span>
<h1><img src="<?php echo get_style_cdnurl();?>paimai/yunying/images/yun_logo.jpg"></h1>
</div>
</div>
<div class="mian">
    <div class="mianL">
    <dl>
        <dd>
            <a id="menu_sy" href="/Index/index" class="shouye">首页</a>
        </dd>
        <?php foreach ($tree_menu as $key => $value): ?>
          <dd>
            <span id="menu_<?php echo ($value['first_char']); ?>" ><img src="<?php echo get_style_cdnurl();?>paimai/yunying/images/yun_jia.jpg"><?php echo ($value['name']); ?></span>
            <ul style="display: none;">
                <?php if (!empty($value['children'])): ?>
                    <?php foreach ($value['children'] as $k => $v): ?>
                        <li><a id='menu_<?php echo ($v["first_char"]); ?>' href="<?php echo ($v['url']); ?>"><?php echo ($v['name']); ?></a></li>
                    <?php endforeach ?>
                <?php endif ?>
            </ul>
        <?php endforeach ?>
    </dl>
</div>

<?php $menu = 'cwgl.skd'; ?>
<?php $menu=json_encode(explode('.', $menu)); ?>
<script>
    $(function () {
        var cur_menu = '<?php echo ($menu); ?>', cur_menu = eval('[' + cur_menu + ']'), cur_menu = cur_menu[0];
        if (cur_menu == "sy") {
            $("#menu_sy").removeClass('shouye').addClass('current');
        }
        $('#menu_' + cur_menu[0]).click();
        $('#menu_' + cur_menu[0]).find("img").attr("src", "http://img1.isou365.cn/paimai/yunying/images/yun_jie.jpg");
        $(".mianL").css("height", $(document).height() - 95);
        $('#menu_' + cur_menu[1]).addClass('current');
    });
</script>
    <div class="mianR">
        <table class="receivables-cont">
            <tbody>
            <tr>
                <td>收款单号</td>
                <td><?php echo ($info["collection_no"]); ?></td>
                <td>收款类型</td>
                <td><?php echo $collection_type_list[$info['payment_type']];?></td>
                <td>收款单创建时间</td>
                <td><?php echo ($info["create_time"]); ?></td>
            </tr>
            <tr>
                <td>车辆编号</td>
                <td><?php echo ($info["car_source_nu"]); ?></td>
                <td>收款单状态</td>
                <td><?php echo ($info["status_cn"]); ?></td>
                <td>收款完成时间</td>
                <td><?php echo ($info["update_time"]); ?></td>
            </tr>
            <tr>
                <td>拍单号</td>
                <td><?php echo ($info["order_no"]); ?></td>
                <td>收款金额</td>
                <td><?php echo ($info["amount"]); ?> 元</td>
            </tr>
            <tr>
                <td>变更单号</td>
                <td><?php echo ($info["change_no"]); ?></td>
                <td>收款人</td>
                <td><?php echo ($info["emp_name"]); ?></td>
            </tr>
            </tbody>
        </table>
        <div>
        <h3 class="yonghu">收款明细</h3>
        <table class="receivables-cont" style="width: 50%; margin-top:0;float: left; margin-right: 10px;">
            <tbody>
            <tr>
                <td>收款金额</td>
                <td><?php echo ($info["amount"]); ?></td>
            </tr>
            <?php if($info['payment_type']==1 || $info['payment_type']==3):?>
              <tr>
                <td>手续费</td>
                <?php if($info['status']==0):?>
                <td><input id="poundage" type="text" value="" /></td>
                <?php else:?>
                <td><?php echo ($info["poundage"]); ?></td>
                <?php endif;?>
              </tr>
            <?php endif;?>
            </tbody>
        </table>

        <?php if(in_array($info['payment_type'],$status_group['ORDER'])):?>
            <table class="receivables-cont" style="width: 47%;margin-top:0;float: right;">
                <tbody>
                <tr>
                    <td></td>
                    <td>车款</td>
                    <td><?php echo ($fee["success_price"]); ?></td>
                </tr>
                <tr>
                    <td>-</td>
                    <td>抽奖立减</td>
                    <td><?php echo ($fee["lottery"]); ?></td>
                </tr>
                <tr>
                    <td>-</td>
                    <td>线下活动减免</td>
                    <td><?php echo ($fee["activity_reduction"]); ?></td>
                </tr>
                <tr>
                    <td>-</td>
                    <td>代金券</td>
                    <td><?php echo ($fee["coupon"]); ?></td>
                </tr>
                <tr>
                    <td>+</td>
                    <td>交易服务费</td>
                    <td><?php echo ($fee["commision"]); ?></td>
                </tr>
                <tr>
                    <td>+</td>
                    <td>交付服务费</td>
                    <td><?php echo ($fee["transfer_fee"]); ?></td>
                </tr>
                <tr>
                    <td>=</td>
                    <td>车商应收</td>
                    <td><?php echo ($fee["final_price"]); ?></td>
                </tr>

                </tbody>
            </table>
        <?php endif;?>
        </div>
        <div class="clear"></div>
        <!--<table class="receivables-cont" style="width:400px;">-->
            <!--<thead>-->
            <!--<tr>-->
                <!--<th>应收</th>-->
                <!--<th>实收</th>-->
                <!--<th>未收</th>-->
            <!--</tr>-->
            <!--</thead>-->
            <!--<tbody>-->
            <!--<tr>-->
                <!--<td><?php echo ($fee["final_price"]); ?></td>-->
                <!--<td><?php echo ($info["amount"]); ?></td>-->
                <!--<td><?php echo ($fee['final_price'] - $info['amount']); ?></td>-->
            <!--</tr>-->
            <!--</tbody>-->
        <!--</table>-->
        <div class="yongBtn">
            <?php if($info['status']==0):?>
            <input type="button" class="quxiao" id="confirmCollect" value="确认收款">
            <?php endif;?>
            <input type="button" class="quxiao" onclick="window.close()" value="关闭">
        </div>
        <div class="clear"></div>
    </div>
</div>
</body>
<script type="text/javascript">

    $("#confirmCollect").click(function () {
        var poundage = $("#poundage").val()
        if(typeof(poundage)=='undefined'){
            _confirmPost()
        }else {
            poundage = Number(poundage)
            if( /^-?\d+\.?\d{0,2}$/.test(poundage) == false){
                shibai_alert1("所填写金额不得超过小数点后两位",1000)
                return
            }
            confirm_alert1("您确认手续费为 <span style='color: #ff0000;'>"+poundage+"</span> 元", _confirmPost)
        }
    });
    
    function _confirmPost() {
        $(".yunBei").css("display",'block');
        var poundage = $("#poundage").val()
        var postData = {
            'cid':"<?php echo $info['id'];?>",
            'poundage':poundage
        }
        $.post("/Collection/confirm",postData,function (data) {
            if(data.code!=200){
                shibai_alert(data.msg,1000,function () {
                    window.location.reload()
                    return false
                })
            }else {
                btn_alert("确认成功",1000,function () {
                    window.opener.location.reload()
                    window.close()
                })
            }
        },'json');
    }
</script>
<div class="yunBei"></div>
<div class="loading"></div>
</body>
</html>